/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csse3004.GD.PM;

import csse3004.GD.Poll;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

/**
 *public ArrayList getPolls(int userID);
 * @author Lewis Kelly 42007689
 */
public class DisplayParticipantListController implements Controller {

    protected final Log logger = LogFactory.getLog(getClass());

    /**
     *This function is for getting the whole polls which is open for web user
     **/
    public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) {
        ArrayList<Poll> pollList = new ArrayList<Poll>();
        //pollList = new Poll().genTestPoll(); 
        pollList = new Poll().genTestPoll(); //TODO @LEWIS convert to reflect the actual function
        //TODO Change this to read userID session variable
        return new ModelAndView("editparticipantlist", "polls", pollList); //TODO @LEWIS does this need changing?
    }
}
